$(function(){
    $("input").eq(0).blur(function(){
        var val = $(this).val();
        //http://47.104.244.134:8080/
        
        $.get("http://47.104.244.134:8080/username.do",{username:val},function(data){
            if(data.code==0){
                $(".kun1").css("display","block");
            }
        })
        
    })
    $("input").eq(2).blur(function(){
        var val = $(this).val();
        //http://47.104.244.134:8080/
        
        $.get("http://47.104.244.134:8080/useremail.do",{email:val},function(data){
            if(data.code==0){
                $(".kun1").css("display","block");
            }
        })
        
    })
    
    $("#btn").click(function(){
        $.post("http://47.104.244.134:8080/usersave.do",{
            username:$("input").eq(0).val(),
            password:$("input").eq(1).val(),
            email:$("input").eq(2).val(),
        },function(data){
            if(data.code==0){
                $(".kun1").css("display","block");
            }if(data.code==1){
                $(".kun1").css("display","none");
            }
        })
    });
    $(".kun1").click(function(){
       $(this).css("display","none")
    })
})
